//引入需要加载的全局组件
import SvgIcon from '@/components/SvgIcon/index.vue'
import Category from '@/components/Category/index.vue'
import type { App, Component } from 'vue'
//引入所有图标组件
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// import { app } from 'vue';
const components: { [name: string]: Component } = {
  SvgIcon,
  Category,
}

export default {
  install(app: App) {
    Object.keys(components).forEach((key: string) => {
      app.component(key, components[key])
    })
    //elementPlus注册全局组件

    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
      app.component(key, component)
    }
  },
}
